<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta charset="UTF-8">
	<title>1号店登录页面</title>
	<link rel="stylesheet" type="text/css" href="<%=basePath%>/css/login_css.css" />
</head>
<body>
	<iframe name="buttom" scrolling="no" marginwidth=0 marginheight=0
		width=100% height=160 src="header_htl_2.html" frameborder=0></iframe>
		<div id="box_main">
			<div id="loginPic"></div>
			<div id="login_check">
				<ul>
					<li>
						<h4>1号店用户登录</h4>
						<span id="loginMsg" style="color:red;"></span>
					</li>
					<li>账号:&nbsp;<input type="text" class="userInput" id="login_id" 
						name="user" style="color:black" /><br /></li>
					<li>密码:&nbsp;<input type="password" class="userInput" id="password"
						name="pass"  style="color:black"/><br /> <span id="msg">点击登录，表示您同意1号店<a
							href="http://cms.yhd.com/cms/view.do?topicId=10">《服务协议及隐私声明》</a></span>
					</li>
					<li><input type="submit" value="登&nbsp;&nbsp;&nbsp;录" id="input1"></li>
					<li id="li1">
						<p id="login_type" style="float:left;position: relative;left: 500px;">更多合作账号登录</p>
						<p id="register" style="float:left">
							还没有账号？<a style="color: red;" href="regist2.jsp">30秒注册</a>
						</p>
						<div style="clear:both">
							<button class="login_type" title="QQ">
								<img src="img/login/QQ.png" />
							</button>
							<button class="login_type" title="支付宝">
								<img src="img/login/alipay.png" />
							</button>
							<button class="login_type" title="新浪">
								<img src="img/login/sina.png" />
							</button>
							<button class="login_type" title="360">
								<img src="img/login/360.png" />
							</button>
							<button class="login_type" title="百度">
								<img src="img/login/baidu.png" />
							</button>
							<button class="login_type" title="微信">
								<img src="img/login/wecht.png" />
							</button>
							<button class="login_type" title="人人网">
								<img src="img/login/renren.png" />
							</button>
						</div>
					</li>
				</ul>
			</div>
		</div>
		<iframe name="buttom" marginwidth=0 scrolling="no" marginheight=0
			width=100% height=120 src="buttom_htl.html" frameborder=0></iframe>
		<script type="text/javascript" src="js/jquery-3.2.1.js"></script>
		<script type="text/javascript" src="js/login_js.js"></script>
		<script>
		$('#input1').click(function(){
			$.ajax({
	            url:"LoginServlet",
	            type:"post",  //提交方式，post或get
		 		    async:true, 	//同步或者异步方式，true表示异步，异步方式不会阻塞当前网页,但是会造成处理已经完成但是请求还没完成
	             datatype:'text',
		 			data:{
		 				user: $("#login_id").val(),
		 				pass: $("#password").val(),
		 				},  //提交的请求参数，是键值对，用：隔开
		 			success:function(redata){ //请求成功的回调函数，参数是响应的返回值
		 				if('passwordError' == redata) {
		 					$('#loginMsg').html("密码错误");
		 				} else if('unHaveError' == redata){
		 					$('#loginMsg').html("此用户不存在");
		 				} else {
		 					window.location = 'search.goods?likeword=';
		 				}
		 			}
	        });
		});
		</script>
</body>
</html>